import React, { lazy, Suspense } from "react";
import { HashRouter, Routes, Route, Navigate, useNavigate, Router } from "react-router-dom";
import './index.css'

const Index = lazy(() => import('../pages/index/index'))
const Manage = lazy(() => import('../pages/manage/manage'))
const Shoplist = lazy(() => import('../pages/management/shoplist/shoplist'))
const Userlist = lazy(() => import('../pages/management/userlist/userlist'))
function router() {
    return (
        <HashRouter>
            <Suspense fallback={''}>
                <Routes>
                    <Route path='/' element={<Index />}>
                        <Route path='' element={<Manage />}></Route>
                        <Route path='/manage' element={<Manage />}></Route>
                        <Route path='/shoplist' element={<Shoplist />}></Route>
                        <Route path='/userlist' element={<Userlist />}></Route>
                    </Route>
                </Routes>
            </Suspense>
        </HashRouter>
    );
}

export default router;

// const BasicRoute = () => (
//     <HashRouter>
//         <Suspense fallback={''}>
//             <Routes>
//                 {/* <Route path='/' element={<Index />}>  </Route> */}
//                 {/* <Route path='/Login' element={<Login />}></Route>
//                 <Route path='/Shopcart' element={<Shopcart />}></Route> */}
//             </Routes>
//         </Suspense>
//     </HashRouter>
// );
// export default BasicRoute